﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using GameEngine.Scenes;
using Microsoft.Xna.Framework;

namespace GuiLibrary.Components
{
    public class SelectableLabel: Label, ISelectableComponent
    {

        public SelectableLabel(Component parent, Vector2 relPosition, Text text, Element elementAssociated) :
            base(parent, relPosition, text, elementAssociated)
        { }
        public SelectableLabel(Component parent, Vector2 relPosition, Text text) :
            this(parent, relPosition, text, null) { }

        public SelectableLabel(Component parent, Text text) :
            this(parent, new Vector2(), text, null) { }

        #region ISelectableComponent Members

        public Element getAssociatedElement() 
        {
            return elementAssociated;
        }

        public bool isPointed() 
        {
            return text.isFlashing;
        }

        public void onComponentPointed()
        {
            text.isFlashing = true;
        }

        public void onComponentUnpointed()
        {
            text.isFlashing = false;
        }

        #endregion
    }
}
